<?php
/**
 * 轻云网络验证系统
 * =======================================================
 * 版权所有(C) 2019-2039 daenx.cn，并保留所有权利。
 * 作者：Daen大恩
 * 作者QQ: 1330166565
 * 开发群：661059773
 * =======================================================
 */
include '../data/config.php';
$cp=$_GET['cp'];
$qq=$_GET['qq'];
$rq=$_GET['rq'];
$nrq=$_GET['nrq'];
$key=$_GET['key'];

if($key != "imdaen")
{
	echo 0;die();
}
else
{
	$SQL = "SELECT * FROM `authorize` WHERE `domain`='$rq' and `ycp`='$cp'";
	$query=mysqli_query($con,$SQL);
	$row =mysqli_fetch_array($query);
	$id = $row[id];
	$qq1 = $row[qq];
			
	if(mysqli_num_rows($query) == 1)
	{
		if($qq == $qq1)
		{	
			$SQL = "SELECT * FROM `authorize` WHERE `domain`='$nrq' and `ycp`='$cp'";
			$query=mysqli_query($con,$SQL);
			$row =mysqli_fetch_array($query);
			if(mysqli_num_rows($query) == 1)
				{echo 7;}
				else
				{
				$sql = "UPDATE `authorize` SET `domain` = '$nrq' WHERE id='$id';";
				mysqli_query($con,$sql); 
				echo 1;
				}
		}
		else
		{echo 4;}
	}
	else
		{echo 6;}
}
?>